package com.adb.indian.rto.ui;

import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

import com.adb.indian.rto.R;
import com.adb.indian.rto.actionbarcompat.ActionBarActivity;

public class StatesActivity extends ActionBarActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        showWindowTitleBar(true);
        showWindowFullScreen(true);
        setContentView(R.layout.activity_state_list);
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater menuInflater = getMenuInflater();
        menuInflater.inflate(R.menu.activity_splash, menu);

        // Calling super after populating the menu is necessary here to ensure that the
        // action bar helpers have a chance to handle this event.
        return super.onCreateOptionsMenu(menu);
        
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    	switch (item.getItemId()) {
		case R.id.menu_share:
			break;
		case R.id.menu_refresh:
			getActionBarHelper().setRefreshActionItemState(true);
			new Handler().postDelayed(new Runnable() {
				
				public void run() {
					getActionBarHelper().setRefreshActionItemState(false);
				}
			}, 1000);
			break;

		default:
			break;
		}
    	return super.onOptionsItemSelected(item);
    }
    
}
